﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

public class LogFile
{
    public static void WriteLog(string _msg)
    {
        try
        {
            string Log_Name = DateTime.Now.ToString("yyyyMMdd") + ".log";
            string Log_Path = System.Configuration.ConfigurationSettings.AppSettings["LogPath"].ToString();
            string Log_FullName = Log_Path + Log_Name;
            StreamWriter sw = new StreamWriter(Log_FullName, true, Encoding.GetEncoding("Gb2312"));
            sw.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "  " + _msg);
            sw.Close();
        }
        catch
        { }
    }
}

